package com.oa.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.oa.dao.UserMarkDao;
import com.oa.entity.Mark;
import com.oa.service.UserMarkService;
@Service("userMarkService")
@Transactional
public class UserMarkServiceImpl implements UserMarkService{
	@Resource(name="userMarkDao")
	private UserMarkDao usermarkdao;
	//添加便签
	@Override
	public boolean UserMarkAdd(Mark user) {
		System.out.println("aaaaaaaaaaaaaaaa"+user.getUser().getUser_name());
		return usermarkdao.saveEntity(user);
	}
	//查询所有便签
	public List<Mark> list() {
		return usermarkdao.findAllEntity();
	}
	//修改便签
	public boolean UserMarkUpdate(Mark user) {
		return usermarkdao.updateEntity(user);
	}
	//删除便签
	public boolean UserMarkDelete(Mark user) {
		return usermarkdao.deleteEntity(user);
	}
	//根据Id查询
	public Mark getById(String unique_id) {
		return usermarkdao.getEntity(unique_id);
	}

	//根据Id查询所有便签
	@Override
	public List<Mark> selectAllMak(String id) {
		return usermarkdao.getMarkByIds(id);
	}
}
